package com.frombottom2top.hexdefence.allactivity;

import android.app.Activity;
import android.content.Intent;
import android.content.pm.ActivityInfo;
import android.os.Bundle;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
import android.widget.Button;

import com.frombottom2top.hexdefence.R;

public class MainActivity extends Activity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        //full screen
        getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
                WindowManager.LayoutParams.FLAG_FULLSCREEN);
        //no title
        this.requestWindowFeature(Window.FEATURE_NO_TITLE);
        //portrait screen
        setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);

        //current view, execute layout.activity_main
        setContentView(R.layout.activity_main);

        //start button
        Button start = (Button)findViewById(R.id.start);
        start.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(MainActivity.this, ModuleChoice.class);
                MainActivity.this.startActivity(intent);
            }
        });

        //continue button
        Button continuegame = (Button)findViewById(R.id.continuegame);
        continuegame.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(MainActivity.this, ContinueGame.class);
                MainActivity.this.startActivity(intent);
            }
        });

        //game method button
        Button gamemethod = (Button)findViewById(R.id.gamemethod);
        gamemethod.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(MainActivity.this, GameMethod.class);
                MainActivity.this.startActivity(intent);
            }
        });

        //aboutgame button
        Button aboutgame = (Button)findViewById(R.id.aboutgame);
        aboutgame.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(MainActivity.this, AboutGame.class);
                MainActivity.this.startActivity(intent);
            }
        });

        //exit button
        Button exit = (Button)findViewById(R.id.exit);
        exit.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                System.exit(0);
            }
        });

    }

    @Override
    protected void onResume() {
        super.onResume();
    }

    @Override
    protected void onStop() {
        super.onStop();
    }
}
